export * from './hooks';
export * from './ajax';

export function getEnv() {
  const { hostname } = window.location;
  if (process.env.NODE_ENV === 'development') {
    return 'dev';
  }
  if (/^dev\.|localhost|127.0.0.1/.test(hostname)) {
    return 'dev';
  }

  return 'prod';
}

export const toNumberString = (value: number) => value.toString().replace(/\B(?=(\d{3})+\b)/g, ',');
